/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package th.model;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author MSI
 */

@Entity
@Table(name = "pilihan_destinasi")
@NamedQueries({
     @NamedQuery(name = "PilihanDestinasi.findAll", query = "SELECT p FROM PilihanDestinasi p")})
public class PilihanDestinasi implements Serializable {
    
     private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id_pilihan_destinasi")
    private Integer idPilihanDestinasi; 

   
    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "id_mohon_maklumat")
    private PermohonanMaklumat permohonan;
    
    
    @Column(name = "destinasi_pergi")
    private String destinasiPergi;
    
    @Column(name = "destinasi_tiba")
    private String destinasiTiba;
    
      @Embedded
    private InfoAudit infoAudit;

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 19 * hash + (this.idPilihanDestinasi != null ? this.idPilihanDestinasi.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final PilihanDestinasi other = (PilihanDestinasi) obj;
        if (this.idPilihanDestinasi != other.idPilihanDestinasi && (this.idPilihanDestinasi == null || !this.idPilihanDestinasi.equals(other.idPilihanDestinasi))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "PilihanDestinasi{" + "idPilihanDestinasi=" + idPilihanDestinasi + '}';
    }

  

    public Integer getIdPilihanDestinasi() {
        return idPilihanDestinasi;
    }

    public void setIdPilihanDestinasi(Integer idPilihanDestinasi) {
        this.idPilihanDestinasi = idPilihanDestinasi;
    }        

    public PermohonanMaklumat getPermohonan() {
        return permohonan;
    }

    public void setPermohonan(PermohonanMaklumat permohonan) {
        this.permohonan = permohonan;
    }
        
    public String getDestinasiPergi() {
        return destinasiPergi;
    }

    public void setDestinasiPergi(String destinasiPergi) {
        this.destinasiPergi = destinasiPergi;
    }

    public String getDestinasiTiba() {
        return destinasiTiba;
    }

    public void setDestinasiTiba(String destinasiTiba) {
        this.destinasiTiba = destinasiTiba;
    }

    public InfoAudit getInfoAudit() {
        return infoAudit;
    }

    public void setInfoAudit(InfoAudit infoAudit) {
        this.infoAudit = infoAudit;
    }
    
    
 }
    
    
    
    

